How to set the order of the chart tooltip display content?
Question Description
I am using VChart, as shown in the following figure. How should I set the order of the data items displayed in the dimension tooltip? For example, set it to the descending order of the key value.
Solution
VChart's tooltip provides updateContent
callback support for making arbitrary modifications to the displayed content, which can be configured in the tooltip spec. In the updateContent
callback, the displayed content is provided as an array parameter, and you only need to make modifications before returning a new array. This can completely include sorting. The following examples can be referenced:
Code Example
Result
Quote
github:https://github.com/VisActor/VChart
Demo page: https://www.visactor.io/vchart/demo/bar-chart/stack-column